load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "cmddebugrefreshconfig",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "features": {
            "default": [],
            "fb": ["sapling-configloader/fb"],
        },
        "lib": {"name": "cmddebugrefreshconfig"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "GPL-2.0-only",
            "name": "cmddebugrefreshconfig",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    features = ["fb"],
    deps = [
        "//eden/scm/lib/clidispatch:clidispatch",
        "//eden/scm/lib/commands/cmdutil:cmdutil",
    ] + ([] if rust_oss.is_oss_build() else [
        "//eden/scm/lib/config/loader:configloader",
        "//eden/scm/lib/repo/repo-minimal-info:repo-minimal-info",
    ]),
)
